import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/closure/gate_plan_view_entity.dart';

GatePlanViewEntity $GatePlanViewEntityFromJson(Map<String, dynamic> json) {
  final GatePlanViewEntity gatePlanViewEntity = GatePlanViewEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    gatePlanViewEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    gatePlanViewEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    gatePlanViewEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    gatePlanViewEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    gatePlanViewEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    gatePlanViewEntity.id = id;
  }
  final String? planView = jsonConvert.convert<String>(json['planView']);
  if (planView != null) {
    gatePlanViewEntity.planView = planView;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    gatePlanViewEntity.remark = remark;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    gatePlanViewEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    gatePlanViewEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    gatePlanViewEntity.updateDate = updateDate;
  }
  final String? viewName = jsonConvert.convert<String>(json['viewName']);
  if (viewName != null) {
    gatePlanViewEntity.viewName = viewName;
  }
  return gatePlanViewEntity;
}

Map<String, dynamic> $GatePlanViewEntityToJson(GatePlanViewEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['planView'] = entity.planView;
  data['remark'] = entity.remark;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['viewName'] = entity.viewName;
  return data;
}

extension GatePlanViewEntityExtension on GatePlanViewEntity {
  GatePlanViewEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? planView,
    String? remark,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? viewName,
  }) {
    return GatePlanViewEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..planView = planView ?? this.planView
      ..remark = remark ?? this.remark
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..viewName = viewName ?? this.viewName;
  }
}
